package com.ee.bruscar.configuration.maker;

import com.ee.bruscar.configuration.hint.Hint;

public class StringMaker extends AbstractMaker
{

	public StringMaker(Hint hint)
	{
		super(hint);
	}

	public Object make()
	{
		String[] options = hint.getValue().split(",");
		int index = getRandomIndex( options.length );
		return options[index];
	}
	
	public int getRandomIndex(int length)
	{
		double random = Math.random();
		double multiplied = random * length;
		
		Double dbl = new Double( multiplied );
		return dbl.intValue();
	}

}
